﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yammu.Core.VirtualFileSystem;

namespace Yammu.Core.MediaManagement
{
    public class ConfiguredConfiguredMediaPath : IConfiguredMediaPath
    {
        private string _userSpecifiedName;

        public ConfiguredConfiguredMediaPath()
        {
            
        }

        public ConfiguredConfiguredMediaPath(IVFSProvider provider, string fullPath, bool resursive)
        {
            VFSProvider = provider;
            FullPath = fullPath;
            Recursive = resursive;
        }
        #region Implementation of IConfiguredMediaPath

        public string UserSpecifiedName
        {
            get { return _userSpecifiedName; }
            set { _userSpecifiedName = value; }
        }

        public IVFSProvider VFSProvider { get; set; }
        public string FullPath { get; set; }
        public bool Recursive { get; set; }
        #endregion

        public static  bool operator == (ConfiguredConfiguredMediaPath path1, ConfiguredConfiguredMediaPath path2)
        {
            if( path1.VFSProvider.Equals(path2.VFSProvider) && path1.FullPath==path2.FullPath && path1.Recursive == path2.Recursive)
            {
                return true;
            }
            return false;
        }

        public static bool operator !=(ConfiguredConfiguredMediaPath path1, ConfiguredConfiguredMediaPath path2)
        {
            return !(path1 == path2);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return this == (obj as ConfiguredConfiguredMediaPath);
        }
    }
}
